package com.woniuxy.commons.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author: Mr·Xiang
 * @create 2024-04-19 10:46
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Resource
    private PermsInterceptor permsInterceptor;

    // 注册拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(permsInterceptor).addPathPatterns("/**");
    }
}
